package com.ccjk.beusoft.hot;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.os.RemoteException;
import android.support.annotation.Nullable;

/**
 * Created by CCJK on 2018/11/3.
 */

public class BinderPoolService extends Service {

    public static final int  COMPUTE=0;
    public static  final int SECURITY=1;


    @Nullable
    @Override
    public IBinder onBind(Intent intent) {
        return new IBinderPool.Stub() {
            @Override
            public IBinder queryBinder(int binderCode) throws RemoteException {
                if(binderCode==COMPUTE){
                    return new IComputeImpl();
                }else if(binderCode==SECURITY){
                    return new ISecurityCenterImpl();
                }
                return null;
            }
        };
    }
}
